<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="message" class="com.boc.image.web.UserMessage"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="sun.misc.BASE64Decoder"%>
<%@page import="java.util.Map"%>
<%String cType = request.getParameter("cType"); %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>好多图免费图片外链空间</title>
<meta name="copyright" content= "免费图片空间上传 Copyright(c) 2011" />
<meta name="application-name" content="免费图片空间上传" />
<meta name="keywords" content="淘宝相册|免费相册|外链免费相册|淘宝图片空间|淘宝免费相册|淘宝外链相册|免费可外链相册|图片外链网站" /> 
<meta name="description" content="专业淘宝相册,外贸相册,提供稳定的淘宝图片存储空间，支持相册批量上传、批量贴图。中国唯一的彻底免费的淘宝免费相册。">
<link type="text/css" href="css/user.css" rel="stylesheet"/>
<script type="text/javascript" src="../../js/public.js"></script>
<script type="text/javascript" src="../../js/AjaxProxy.js"></script>
</head>
<script type="text/javascript">
	window.onload = function (){
		$("cTitle").focus();
	}
	function send(){
		if($("cTitle").value == "") {
			alert("请输入发送主题");
			$("cTitle").focus();
			return;
		}
		
		if($("cContent").value == "") {
			alert("请输入发送内容");
			$("cContent").focus();
			return;
		}
		
		var gcMsg = new AjaxProxy();
		gcMsg.addParm("cType",<%=cType%>);
		gcMsg.addParm("cTitle",$("cTitle").value);
		gcMsg.addParm("cContent",$("cContent").value);
		gcMsg.addParm("nMsgid",<%=(cType.equals("0")?request.getParameter("nId"):null)%>);
		gcMsg.invoke("message.writeMessage",false);
		var flag = gcMsg.getString("PN_RET");
		if(flag != 0){
			alert(gcMsg.getString("PC_MSG"));
		}else{
			alert("消息已发送");
			if(<%=request.getParameter("cType")%> == 1) {
				window.location.replace("/filter/user/message");
			}else{
				window.location.replace("/filter/user/messageDetail?nId="+<%=request.getParameter("nId")%>+"&cYdzt=1&cYxhf="+<%=request.getParameter("cYxhf")%>+"&cZt=1");
			}
		}
	}
</script>

<body>
<div class="frame_01">
	<div class="frame_01_left">
		<%if(cType.equals("0")){ %>
			回复信息
		<%}else{ %>
			写信息
		<%} %>
	</div>
	<div class="frame_01_right">
		<a href="/index.html" target="_top">首页</a>&nbsp;》
		<a href="/core" target="_top">管理中心</a>&nbsp;》
		<a href="/filter/user/message" target="content">站内信</a>&nbsp;》
		<%if(cType.equals("0")){ %>
		<a href="/filter/user/messageDetail?nId=<%=request.getParameter("nId") %>&cYdzt=1" target="content">阅读信件</a>&nbsp;》
		<%} %>
		<font color="#000">
			<%if(cType.equals("0")){ %>
				回复信息
			<%}else{ %>
				写信息
			<%} %>
		</font>
	</div>
</div>
<div class="frame_02"></div>

<div class="frame_03" style="overflow:hidden;">
<table width="755" border="0" cellspacing="0">
  <tr>
	<td align="center" valign="top">
		<table width="700" border="0" cellspacing="0">
		<%if(cType.equals("0")){ %>
		  <tr>
			<td width="80" height="30" align="right">原主题</td>
			<td width="620" align="center"><input type="text" style="width:600px;" value="<%=new String(new BASE64Decoder().decodeBuffer(request.getParameter("cTitle"))) %>" class="input_task" readonly="true"></td>
		  </tr>
		<%} %>
		  <tr>
			<td width="80" height="30" align="right">收信人</td>
			<td width="620" align="center"><input type="text" id="nReceiveId" style="width:600px;" value="系统管理员" class="input_task" readonly="true"></td>
		  </tr>
		  <tr>
			<td width="80" height="30" align="right">主题</td>
			<td width="620" align="center"><input type="text" id="cTitle" style="width:600px;" value="" class="input_task"></td>
		  </tr>
		  <tr>
			<td width="80" height="360" align="right">内容</td>
			<td width="620" align="center"><textarea id="cContent" style="width:600px; height:350px;"></textarea></td>
		  </tr>
		</table>
	</td>
  </tr>
</table>
</div>
<div class="frame_03" style="height:35px;">
<table width="755" border="0" cellspacing="0">
  <tr>
	<td align="center" valign="top">
		<table width="700" border="0" cellspacing="0">
		 <tr>
		 	<td align="center" height="35">
				<input type="button" value=" 发 送 " onClick="send()">
			</td>
		 </tr>
		</table>
	</td>
  </tr>
</table>
</div>
<div class="frame_04"></div>
</body>
</html>